\hypertarget{struct_introduction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node}{}\section{Introduction\+To\+Algorithm\+:\+:Tree\+Algorithm\+:\+:Binary\+Tree\+Node$<$ K\+Type $>$ Struct Template Reference}
\label{struct_introduction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node}\index{Introduction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node$<$ K\+Type $>$@{Introduction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node$<$ K\+Type $>$}}


Binary\+Tree\+Node：二叉树的节点，算法导论xx章xx节  




{\ttfamily \#include $<$binarytreenode.\+h$>$}

\subsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
typedef K\+Type \hyperlink{struct_introduction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node_adbd8539e7a907c3a8fe7a8b79e7032e8}{Key\+Type}
\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{struct_introduction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node_a8e8de673785852b0c091916f5fb64e78}{Binary\+Tree\+Node} ()
\begin{DoxyCompactList}\small\item\em 默认构造函数 \end{DoxyCompactList}\item 
\hyperlink{struct_introduction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node_a8382a5ddc6f9c8cbfeacd0f0163d8c4d}{Binary\+Tree\+Node} (const \hyperlink{struct_introduction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node_adbd8539e7a907c3a8fe7a8b79e7032e8}{Key\+Type} \&keyvalue)
\begin{DoxyCompactList}\small\item\em 显式构造函数 \end{DoxyCompactList}\item 
virtual std\+::string \hyperlink{struct_introduction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node_ae552fb23243e499a60ef73375fabe239}{to\+\_\+string} ()
\begin{DoxyCompactList}\small\item\em to\+\_\+string\+:返回该节点的字符串描述 \end{DoxyCompactList}\item 
virtual std\+::string \hyperlink{struct_introduction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node_a694d14f0b33f2f052f11148ecbe1684e}{to\+\_\+xml} ()
\begin{DoxyCompactList}\small\item\em to\+\_\+xml\+:返回以该节点为根的子树的{\ttfamily xml}描述。 \end{DoxyCompactList}\item 
bool \hyperlink{struct_introduction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node_a54a90606ceb604a1a4d01056429a8a06}{is\+\_\+left\+\_\+child} ()
\begin{DoxyCompactList}\small\item\em is\+\_\+left\+\_\+child\+:判断本节点是否左子节点。 \end{DoxyCompactList}\item 
bool \hyperlink{struct_introduction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node_a34c1912a2a7e9caa7a67354218fd7640}{is\+\_\+right\+\_\+child} ()
\begin{DoxyCompactList}\small\item\em is\+\_\+right\+\_\+child\+:判断本节点是否右子节点。 \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Public Attributes}
\begin{DoxyCompactItemize}
\item 
std\+::weak\+\_\+ptr$<$ \hyperlink{struct_introduction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node}{Binary\+Tree\+Node} $>$ \hyperlink{struct_introduction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node_aa94cbc785416ba74505661baac55a9fd}{parent}
\item 
std\+::shared\+\_\+ptr$<$ \hyperlink{struct_introduction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node}{Binary\+Tree\+Node} $>$ \hyperlink{struct_introduction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node_a3e056b1d34820497ac3a23a16180be2b}{lchild}
\item 
std\+::shared\+\_\+ptr$<$ \hyperlink{struct_introduction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node}{Binary\+Tree\+Node} $>$ \hyperlink{struct_introduction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node_aaccc444db582ed362bff4e50efbc47c7}{rchild}
\item 
\hyperlink{struct_introduction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node_adbd8539e7a907c3a8fe7a8b79e7032e8}{Key\+Type} \hyperlink{struct_introduction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node_af3cb8030ab05ccaf1a69a86c9f468b8d}{key}
\end{DoxyCompactItemize}


\subsection{Detailed Description}
\subsubsection*{template$<$typename K\+Type$>$struct Introduction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node$<$ K\+Type $>$}

Binary\+Tree\+Node：二叉树的节点，算法导论xx章xx节 

任何一个节点都有两个强引用指向左右子节点，以及一个弱引用指向它的父节点。节点还有一个{\ttfamily key}成员包含具体的数据 

Definition at line 31 of file binarytreenode.\+h.



\subsection{Member Typedef Documentation}
\hypertarget{struct_introduction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node_adbd8539e7a907c3a8fe7a8b79e7032e8}{}\index{Introduction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node@{Introduction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node}!Key\+Type@{Key\+Type}}
\index{Key\+Type@{Key\+Type}!Introduction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node@{Introduction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node}}
\subsubsection[{Key\+Type}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename K\+Type $>$ typedef K\+Type {\bf Introduction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node}$<$ K\+Type $>$\+::{\bf Key\+Type}}\label{struct_introduction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node_adbd8539e7a907c3a8fe7a8b79e7032e8}
节点保存的数据的类型 

Definition at line 34 of file binarytreenode.\+h.



\subsection{Constructor \& Destructor Documentation}
\hypertarget{struct_introduction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node_a8e8de673785852b0c091916f5fb64e78}{}\index{Introduction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node@{Introduction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node}!Binary\+Tree\+Node@{Binary\+Tree\+Node}}
\index{Binary\+Tree\+Node@{Binary\+Tree\+Node}!Introduction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node@{Introduction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node}}
\subsubsection[{Binary\+Tree\+Node()}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename K\+Type $>$ {\bf Introduction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node}$<$ K\+Type $>$\+::{\bf Binary\+Tree\+Node} (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}\label{struct_introduction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node_a8e8de673785852b0c091916f5fb64e78}


默认构造函数 

所有的成员变量都采取默认值 

Definition at line 39 of file binarytreenode.\+h.

\hypertarget{struct_introduction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node_a8382a5ddc6f9c8cbfeacd0f0163d8c4d}{}\index{Introduction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node@{Introduction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node}!Binary\+Tree\+Node@{Binary\+Tree\+Node}}
\index{Binary\+Tree\+Node@{Binary\+Tree\+Node}!Introduction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node@{Introduction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node}}
\subsubsection[{Binary\+Tree\+Node(const Key\+Type \&keyvalue)}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename K\+Type $>$ {\bf Introduction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node}$<$ K\+Type $>$\+::{\bf Binary\+Tree\+Node} (
\begin{DoxyParamCaption}
\item[{const {\bf Key\+Type} \&}]{keyvalue}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [explicit]}}\label{struct_introduction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node_a8382a5ddc6f9c8cbfeacd0f0163d8c4d}


显式构造函数 


\begin{DoxyParams}{Parameters}
{\em keyvalue\+:节点要保存的数据内容} & 指定{\ttfamily key}成员需要赋值的数据 \\
\hline
\end{DoxyParams}


Definition at line 48 of file binarytreenode.\+h.



\subsection{Member Function Documentation}
\hypertarget{struct_introduction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node_a54a90606ceb604a1a4d01056429a8a06}{}\index{Introduction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node@{Introduction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node}!is\+\_\+left\+\_\+child@{is\+\_\+left\+\_\+child}}
\index{is\+\_\+left\+\_\+child@{is\+\_\+left\+\_\+child}!Introduction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node@{Introduction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node}}
\subsubsection[{is\+\_\+left\+\_\+child()}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename K\+Type $>$ bool {\bf Introduction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node}$<$ K\+Type $>$\+::is\+\_\+left\+\_\+child (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}\label{struct_introduction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node_a54a90606ceb604a1a4d01056429a8a06}


is\+\_\+left\+\_\+child\+:判断本节点是否左子节点。 

\begin{DoxyReturn}{Returns}
返回{\ttfamily true}或者{\ttfamily false} 该函数判断本节点是否是左子节点。如果本节点的父节点为空，则返回{\ttfamily false}；如果本节点的父节点非空且本节点是父节点的左子节点，则返回{\ttfamily true}；否则返回{\ttfamily false} 
\end{DoxyReturn}


Definition at line 99 of file binarytreenode.\+h.

\hypertarget{struct_introduction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node_a34c1912a2a7e9caa7a67354218fd7640}{}\index{Introduction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node@{Introduction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node}!is\+\_\+right\+\_\+child@{is\+\_\+right\+\_\+child}}
\index{is\+\_\+right\+\_\+child@{is\+\_\+right\+\_\+child}!Introduction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node@{Introduction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node}}
\subsubsection[{is\+\_\+right\+\_\+child()}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename K\+Type $>$ bool {\bf Introduction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node}$<$ K\+Type $>$\+::is\+\_\+right\+\_\+child (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}\label{struct_introduction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node_a34c1912a2a7e9caa7a67354218fd7640}


is\+\_\+right\+\_\+child\+:判断本节点是否右子节点。 

\begin{DoxyReturn}{Returns}
返回{\ttfamily true}或者{\ttfamily false} 该函数判断本节点是否是右子节点。如果本节点的父节点为空，则返回{\ttfamily false}；如果本节点的父节点非空且本节点是父节点的右子节点，则返回{\ttfamily true}；否则返回{\ttfamily false} 
\end{DoxyReturn}


Definition at line 113 of file binarytreenode.\+h.

\hypertarget{struct_introduction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node_ae552fb23243e499a60ef73375fabe239}{}\index{Introduction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node@{Introduction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node}!to\+\_\+string@{to\+\_\+string}}
\index{to\+\_\+string@{to\+\_\+string}!Introduction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node@{Introduction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node}}
\subsubsection[{to\+\_\+string()}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename K\+Type $>$ virtual std\+::string {\bf Introduction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node}$<$ K\+Type $>$\+::to\+\_\+string (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [virtual]}}\label{struct_introduction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node_ae552fb23243e499a60ef73375fabe239}


to\+\_\+string\+:返回该节点的字符串描述 

\begin{DoxyReturn}{Returns}
\+: 本节点的描述字符串
\end{DoxyReturn}
该函数打印本节点的{\ttfamily key}，以及父节点（若存在）、子节点（若存在）的{\ttfamily key} 

Definition at line 58 of file binarytreenode.\+h.

\hypertarget{struct_introduction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node_a694d14f0b33f2f052f11148ecbe1684e}{}\index{Introduction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node@{Introduction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node}!to\+\_\+xml@{to\+\_\+xml}}
\index{to\+\_\+xml@{to\+\_\+xml}!Introduction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node@{Introduction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node}}
\subsubsection[{to\+\_\+xml()}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename K\+Type $>$ virtual std\+::string {\bf Introduction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node}$<$ K\+Type $>$\+::to\+\_\+xml (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [virtual]}}\label{struct_introduction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node_a694d14f0b33f2f052f11148ecbe1684e}


to\+\_\+xml\+:返回以该节点为根的子树的{\ttfamily xml}描述。 

\begin{DoxyReturn}{Returns}
\+: 本节点子树的{\ttfamily xml}描述的字符串
\end{DoxyReturn}
该函数返回以本节点为根的子树的{\ttfamily xml}描述。对子节点递归调用从而生成{\ttfamily xml}数据 

Definition at line 79 of file binarytreenode.\+h.



\subsection{Member Data Documentation}
\hypertarget{struct_introduction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node_af3cb8030ab05ccaf1a69a86c9f468b8d}{}\index{Introduction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node@{Introduction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node}!key@{key}}
\index{key@{key}!Introduction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node@{Introduction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node}}
\subsubsection[{key}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename K\+Type $>$ {\bf Key\+Type} {\bf Introduction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node}$<$ K\+Type $>$\+::key}\label{struct_introduction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node_af3cb8030ab05ccaf1a69a86c9f468b8d}
节点的保存的数据 

Definition at line 125 of file binarytreenode.\+h.

\hypertarget{struct_introduction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node_a3e056b1d34820497ac3a23a16180be2b}{}\index{Introduction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node@{Introduction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node}!lchild@{lchild}}
\index{lchild@{lchild}!Introduction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node@{Introduction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node}}
\subsubsection[{lchild}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename K\+Type $>$ std\+::shared\+\_\+ptr$<${\bf Binary\+Tree\+Node}$>$ {\bf Introduction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node}$<$ K\+Type $>$\+::lchild}\label{struct_introduction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node_a3e056b1d34820497ac3a23a16180be2b}
节点的左子节点的强引用 

Definition at line 123 of file binarytreenode.\+h.

\hypertarget{struct_introduction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node_aa94cbc785416ba74505661baac55a9fd}{}\index{Introduction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node@{Introduction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node}!parent@{parent}}
\index{parent@{parent}!Introduction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node@{Introduction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node}}
\subsubsection[{parent}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename K\+Type $>$ std\+::weak\+\_\+ptr$<${\bf Binary\+Tree\+Node}$>$ {\bf Introduction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node}$<$ K\+Type $>$\+::parent}\label{struct_introduction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node_aa94cbc785416ba74505661baac55a9fd}
节点的父节点的弱引用 

Definition at line 122 of file binarytreenode.\+h.

\hypertarget{struct_introduction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node_aaccc444db582ed362bff4e50efbc47c7}{}\index{Introduction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node@{Introduction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node}!rchild@{rchild}}
\index{rchild@{rchild}!Introduction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node@{Introduction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node}}
\subsubsection[{rchild}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename K\+Type $>$ std\+::shared\+\_\+ptr$<${\bf Binary\+Tree\+Node}$>$ {\bf Introduction\+To\+Algorithm\+::\+Tree\+Algorithm\+::\+Binary\+Tree\+Node}$<$ K\+Type $>$\+::rchild}\label{struct_introduction_to_algorithm_1_1_tree_algorithm_1_1_binary_tree_node_aaccc444db582ed362bff4e50efbc47c7}
节点的右子节点的强引用 

Definition at line 124 of file binarytreenode.\+h.



The documentation for this struct was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
src/tree\+\_\+algorithms/binarytreenode/\hyperlink{binarytreenode_8h}{binarytreenode.\+h}\end{DoxyCompactItemize}
